﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//Sort 3 real values in descending order using nested if statements.

namespace _04DescendingOrder
{
    class _04DescendingOrder
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter three real numbers:");
            Console.Write("a = ");
            string firstValue = Console.ReadLine();
            decimal a = decimal.Parse(firstValue);
            Console.Write("b = ");
            string secondValue = Console.ReadLine();
            decimal b = decimal.Parse(secondValue);
            Console.Write("c = ");
            string thirdValue = Console.ReadLine();
            decimal c = decimal.Parse(thirdValue);

            if ((a >= b) && (b >= c))
            {
                Console.WriteLine("The numbers are {0}, {1}, {2}", a, b, c);
            }
            else
            {
                if ((b >= a) && (a >= c))
                {
                    Console.WriteLine("The numbers are {0}, {1}, {2}", b, a, c);
                }
                else if ((b >= c) && (c >= a))
                {
                    Console.WriteLine("The numbers are {0}, {1}, {2}", b, c, a);
                }
                else if ((c >= b) && (b >= a))
                {
                    Console.WriteLine("The numbers are {0}, {1}, {2}", c, b, a);
                }
                else if ((c >= a) && (a >= b))
                {
                    Console.WriteLine("The numbers are {0}, {1}, {2}", c, a, b);
                }
                else
                {
                    if ((a >= c) && (c >= b))
                    {
                        Console.WriteLine("The numbers are {0}, {1}, {2}", a, c, b);
                    }
                }
            }                
        }
    }
}
